package com.hangan.langchainspringstart.service;

import dev.langchain4j.service.SystemMessage;
import dev.langchain4j.service.UserMessage;
import dev.langchain4j.service.V;
import dev.langchain4j.service.spring.AiService;
import reactor.core.publisher.Flux;

import static dev.langchain4j.service.spring.AiServiceWiringMode.EXPLICIT;

/**
 * 没有对话记忆功能的
 * @author hang an
 * @since 2025/7/29
 */
@AiService(
        wiringMode = EXPLICIT, // 意味手动指定
        chatModel = "openAiChatModel", // 普通对话模型
        streamingChatModel = "openAiStreamingChatModel" // 流式模型
)
public interface StreamChat {
    @SystemMessage(fromResource = "system.txt")
    @UserMessage("我想了解一下{{msg}}")
    Flux<String> chat(@V("msg") String question);

}
